<%@page import="java.util.LinkedHashMap"%>
<%@page import="fr.inserm.u674.chcdbweb.model.DTO.Tissue"%>
<%@ taglib prefix="ccc" uri="http://bibeault.org/tld/ccc" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="extraction" tagdir="/WEB-INF/tags/tissueExtractionTags" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Create/Delete Tissue</title>

<jsp:include page="includes/header.jsp"></jsp:include>
<script type="text/javascript" src="scripts/common.js"></script>
<script type="text/javascript" src="scripts/gridCommon.js"></script>
<script type="text/javascript" src="scripts/newDelTissue.js"></script>

<!-- DHTMLXWINDOWS -->
<link rel="STYLESHEET" type="text/css" href="scripts/dhtmlxwindows-codebase/dhtmlxwindows.css">
<link rel="STYLESHEET" type="text/css" href="scripts/dhtmlxwindows-codebase/skins/dhtmlxwindows_dhx_skyblue.css">
<script type="text/javascript" src="scripts/dhtmlxwindows-codebase/dhtmlxcontainer.js" ></script>
<script type="text/javascript" src="scripts/dhtmlxwindows-codebase/dhtmlxcommon.js" ></script>
<script type="text/javascript" src="scripts/dhtmlxwindows-codebase/dhtmlxwindows.js" ></script>

<!-- DHTMLXGRID -->
<link rel="STYLESHEET" type="text/css" href="scripts/dhtmlxgrid-codebase/dhtmlxgrid.css">
<link rel="STYLESHEET" type="text/css" href="scripts/dhtmlxgrid-codebase/skins/dhtmlxgrid_dhx_skyblue.css">
<link rel="STYLESHEET" type="text/css" href="scripts/dhtmlxgrid-codebase/skins/dhtmlxgrid_dhx_black.css">
<link rel="STYLESHEET" type="text/css" href="scripts/dhtmlxgrid-codebase/skins/dhtmlxgrid_dhx_blue.css">
<script src="scripts/dhtmlxgrid-codebase/dhtmlxcommon.js"></script>
<script src="scripts/dhtmlxgrid-codebase/dhtmlxgrid.js"></script>
<script src="scripts/dhtmlxgrid-codebase/dhtmlxgridcell.js"></script>
<script src="scripts/dhtmlxgrid-codebase/ext/dhtmlxgrid_srnd.js"></script>
<script src="scripts/dhtmlxgrid-codebase/ext/dhtmlxgrid_selection.js"></script>
<script src="scripts/dhtmlxgrid-codebase/ext/dhtmlxgrid_filter.js"></script>
<script src="scripts/dhtmlxgrid-codebase/ext/dhtmlxgrid_nxml.js"></script>

<script type="text/javascript" >

	var existingTissuesList;
	var existingTissueTypesList;
	
	var newTissueTypeDefined;
	var masterTissueDefined;
	
	var dhxWins;
	
	var currentFullTissue;
	
	var tissueTypeGrid;
	
	
</script>


<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body onload="doInitWin();initPage();">

<div id="container">
<div id="top">
<h1>CHC DB Web</h1>
</div>
<div id="leftnav"><jsp:include page="./includes/leftnav.jsp"></jsp:include></div>
<div id="content" >
<h2>Create/Delete Tissue</h2>


<fieldset id="newTissueFieldSet" ><legend>Create New Tissue</legend>
<form id="varInfoForm">
<table>
<tr><td>Tissue CHC ID <span style="font-style: italic;font-size: .8em;">
	(CHC00<span style="color: red;">1</span>T)</span> :</td>
	<td><input id="newTissueCHCID" type="text" size="10" maxlength="10"></td></tr>
<tr><td>Tissue Type ID <span style="font-style: italic;font-size: .8em;">
	(CHC001<span style="color: red;">T</span>)</span> :</td>
	<td><select onchange="checkNewTissueType();" id="newTissueTissueTypeID" ></select></td></tr>

<tr><td>Does this Tissue have a Master Tissue ? :</td>
	<td><select  onchange="checkMasterTissue();" id="hasMasterTissue">
		<option >YES</option>
		<option >NO</option>
		<option selected="selected" >-</option>
		</select>
	</td></tr>
<tr id="mCHCIDrow"><td>Master Tissue CHC ID :</td><td>
	<input id="masterTissueCHCID" type="text" size="10" maxlength="10"></td></tr>
<tr id="mTTIDrow"><td>Master Tissue Tissue Type ID  :</td><td>
	<select id="masterTissueTissueTissueTypeID" ></select></td></tr>
<tr>
<td></td>
<td>
<input id="saveNewTissueButton" type="button" value="Save Tissue" onClick="submitTissue();">
</td>
</tr>
<tr><td colspan="2" align="right" id="linkContainer"></td></tr>
</table>

</form>
</fieldset>
<br/>

<fieldset id="deleteTissueFieldSet"><legend>Delete Existing Tissue</legend>
<form id="deleteTissueForm">
<table>
<tr><td>Tissue CHC ID :</td><td><input type="text" size="10" maxlength="10" id="tissueToDeleteCHCID" /></td></tr>
<tr><td>Tissue Type ID : </td><td><select id="tissueToDeleteTypeID"></select></td></tr>
<tr><td ></td><td><input type="button" value="Delete" onClick="deleteTissue();"></td></tr>
</table>
</form>
</fieldset>
<br/>

<fieldset id="createTissueTypeFieldset"><legend>Create new Tissue Types</legend>
<form id="createTissueTypeForm">
<div id="tissueTypeGridContainer" style="width:450px; height:450px;"></div>
<table>
<tr><td>New Tissue Type ID : </td><td><input id="newTissueTypeID" type="text" size="5" maxlength="5"></td></tr>
<tr><td>New Tissue Type Description : </td><td><textarea id="newTissueTypeDescription"></textarea></td></tr>
<tr><td></td><td><input type="button" onclick="createNewTissueType();" value="Create new Tissue Type"/></td></tr>
</table>
</form>
</fieldset>


</div>
<div id="footer"><jsp:include page="./includes/footer.jsp"/></div>
</div>
</html>